package com.event;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * 事件监听器
 */
@Component
public class DemoListener implements ApplicationListener<DemoEvent> {
	@Override
	public void onApplicationEvent(DemoEvent demoEvent) {
		String msg = demoEvent.getMsg();
		System.out.println("接收到了publisher发布的消息：" + msg);
	}
}
